package com.itheima.service.impl;

import com.itheima.dao.IUserDao;
import com.itheima.domain.User;
import com.itheima.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author shkstart
 * @create 2020-08-02 17:52
 */
@Service("userService")
public class UserServiceImpl implements UserService {
    @Autowired
    private IUserDao iUserDao;


    @Override
    public List<User> findAll() {
        List<User> userList = iUserDao.findAll();

        return userList;
    }

    @Override
    public User findById(Integer id) {
        User user = iUserDao.findById(id);

        return user;
    }

    @Override
    public void Update(User user) {

        iUserDao.updateUser(user);

    }
}
